from django.conf.urls import url
from snippets import views,views1,views2,views3,views4

urlpatterns = [
    url(r'^snippets/$', views.snippet_list),
    url(r'^snippets/(?P<pk>[0-9]+)/$', views.snippet_detail),
    # apiview的url
    url(r'^snippets/apiview/$', views1.snippet_list),
    url(r'^snippets/apiview/(?P<pk>[0-9]+)/$', views1.snippet_detail),
    # class apiview
    url(r'^snippets/classapiview/$', views2.SnippetList.as_view()),
    url(r'^snippets/classapiview/(?P<pk>[0-9]+)/$', views2.SnippetDetail.as_view()),

     # mixins +  generics.GenericAPIView
    url(r'^snippets/mixins/$', views3.SnippetList.as_view()),
    url(r'^snippets/mixins/(?P<pk>[0-9]+)/$', views3.SnippetList.as_view()),

    # generics.ListCreateAPIView
    url(r'^snippets/generics/$', views4.SnippetList.as_view()),
    url(r'^snippets/generics/(?P<pk>[0-9]+)/$', views4.SnippetDetail.as_view()),

    # 用户信息的url
    url(r'^users/$', views4.UserList.as_view()),
    url(r'^users/(?P<pk>[0-9]+)/$', views4.UserDetail.as_view()),
]